/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PagoOnline.java
 *
 * Created on 21/05/2011, 07:38:44 PM
 */

package GUI;

import Interfaz.InterfazControl;
import Motor.ClaseUtilitaria;
import Motor.Cliente;

import javax.swing.ImageIcon;

/**
 *
 * @author Vane
 */
public class PagoOnline extends javax.swing.JFrame {


    /** Creates new form PagoOnline */
	private InterfazControl laInterfaz;
	private Cliente cliente;
    public PagoOnline(InterfazControl laInterfaz) {
		this.laInterfaz=laInterfaz;
        initComponents();
		this.setLocationRelativeTo(null); // Cambiar icono de java en ventana
        this.setIconImage(new ImageIcon("src/imagenes/marketplus2.png").getImage());
		jTFecha.setText(ClaseUtilitaria.tenerFechaActual());
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jCBancos = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jRDelivery = new javax.swing.JRadioButton();
        jRSurcusal = new javax.swing.JRadioButton();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jTNumeroTarjeta = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jTTotal = new javax.swing.JTextField();
        jBCancelarComprarOnline = new javax.swing.JButton();
        jPasswordFieldClaveTarjeta = new javax.swing.JPasswordField();
        jLabel8 = new javax.swing.JLabel();
        jTFecha = new javax.swing.JTextField();
        jTFactura = new javax.swing.JTextField();
        jBComprarOnline1 = new javax.swing.JButton();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(400, 420));
        setResizable(false);
        getContentPane().setLayout(null);

        jCBancos.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Banco Mercantil", "Banco Venezuela", "Banco Caribe" }));
        getContentPane().add(jCBancos);
        jCBancos.setBounds(190, 120, 200, 20);

        jLabel1.setFont(new java.awt.Font("Tempus Sans ITC", 3, 14));
        jLabel1.setText("Pago Online");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(160, 20, 100, 19);

        jLabel2.setText("Fecha");
        getContentPane().add(jLabel2);
        jLabel2.setBounds(250, 70, 40, 14);

        jLabel3.setText("Seleccione su Banco");
        getContentPane().add(jLabel3);
        jLabel3.setBounds(30, 120, 160, 20);

        jRDelivery.setText("Delivery");
        jRDelivery.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRDeliveryActionPerformed(evt);
            }
        });
        getContentPane().add(jRDelivery);
        jRDelivery.setBounds(190, 230, 93, 23);

        jRSurcusal.setText("Sucursal");
        jRSurcusal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRSurcusalActionPerformed(evt);
            }
        });
        getContentPane().add(jRSurcusal);
        jRSurcusal.setBounds(190, 200, 93, 23);

        jLabel4.setText("*Seleccione Tipo de Envio");
        getContentPane().add(jLabel4);
        jLabel4.setBounds(30, 210, 140, 20);

        jLabel5.setText("Introduzca Clave");
        getContentPane().add(jLabel5);
        jLabel5.setBounds(30, 180, 140, 14);

        jLabel6.setText("Introduzca Tarjeta");
        getContentPane().add(jLabel6);
        jLabel6.setBounds(30, 150, 150, 20);

        jTNumeroTarjeta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTNumeroTarjetaActionPerformed(evt);
            }
        });
        jTNumeroTarjeta.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jTNumeroTarjetaKeyTyped(evt);
            }
        });
        getContentPane().add(jTNumeroTarjeta);
        jTNumeroTarjeta.setBounds(190, 150, 200, 20);

        jLabel7.setText("Total BsF+ IVA");
        getContentPane().add(jLabel7);
        jLabel7.setBounds(30, 260, 150, 14);
        getContentPane().add(jTTotal);
        jTTotal.setBounds(190, 260, 200, 20);

        jBCancelarComprarOnline.setFont(new java.awt.Font("Tahoma", 1, 11));
        jBCancelarComprarOnline.setText("Cancelar");
        jBCancelarComprarOnline.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBCancelarComprarOnlineActionPerformed(evt);
            }
        });
        getContentPane().add(jBCancelarComprarOnline);
        jBCancelarComprarOnline.setBounds(210, 300, 170, 40);
        getContentPane().add(jPasswordFieldClaveTarjeta);
        jPasswordFieldClaveTarjeta.setBounds(190, 180, 200, 20);

        jLabel8.setText("Nro Factura");
        getContentPane().add(jLabel8);
        jLabel8.setBounds(250, 90, 70, 14);
        getContentPane().add(jTFecha);
        jTFecha.setBounds(320, 70, 70, 20);

        jTFactura.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jTFacturaKeyTyped(evt);
            }
        });
        getContentPane().add(jTFactura);
        jTFactura.setBounds(320, 90, 70, 20);

        jBComprarOnline1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jBComprarOnline1.setText("Aceptar");
        jBComprarOnline1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBComprarOnline1ActionPerformed(evt);
            }
        });
        getContentPane().add(jBComprarOnline1);
        jBComprarOnline1.setBounds(40, 300, 160, 40);

        jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/marketplus.png"))); // NOI18N
        getContentPane().add(jLabel9);
        jLabel9.setBounds(30, 0, 100, 90);

        jLabel10.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel10.setText("RIF: J-122231245          Desarrollado por: Group Delivery");
        getContentPane().add(jLabel10);
        jLabel10.setBounds(60, 370, 320, 20);

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 10)); // NOI18N
        jLabel11.setText("* Envio de Delivery recargo de un 20% ");
        getContentPane().add(jLabel11);
        jLabel11.setBounds(90, 350, 270, 14);

        pack();
    }// </editor-fold>//GEN-END:initComponents

	private void jRDeliveryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRDeliveryActionPerformed
		// TODO add your handling code here:if (this.jRFemenino.isSelected())
		if (this.jRDelivery.isSelected())
		{
			jRSurcusal.setSelected(false);
		}

	}//GEN-LAST:event_jRDeliveryActionPerformed

	private void jBCancelarComprarOnlineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCancelarComprarOnlineActionPerformed
		// TODO add your handling code here:
		CompraOnline iraCompraOnline = new CompraOnline(laInterfaz, cliente);
		iraCompraOnline.setVisible(true);
		this.dispose();
	}//GEN-LAST:event_jBCancelarComprarOnlineActionPerformed

	private void jBComprarOnline1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBComprarOnline1ActionPerformed
		// TODO add your handling code here:
		FacturaOnline irFacturaOnline=new FacturaOnline(laInterfaz);
	    irFacturaOnline.setVisible(true);
	    this.dispose();
	}//GEN-LAST:event_jBComprarOnline1ActionPerformed

	private void jTNumeroTarjetaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTNumeroTarjetaKeyTyped
		// TODO add your handling code here:
		char c = evt.getKeyChar();
             if (Character.isDigit(c)== false)
                 evt.consume();
	}//GEN-LAST:event_jTNumeroTarjetaKeyTyped

	private void jRSurcusalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRSurcusalActionPerformed
		if (this.jRSurcusal.isSelected())
		{
			jRDelivery.setSelected(false);
		}
	}//GEN-LAST:event_jRSurcusalActionPerformed

	private void jTFacturaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTFacturaKeyTyped
		// TODO add your handling code here:
		char c = evt.getKeyChar();
             if (Character.isDigit(c)== false)
                 evt.consume();
	}//GEN-LAST:event_jTFacturaKeyTyped

	private void jTNumeroTarjetaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTNumeroTarjetaActionPerformed
		// TODO add your handling code here:
	}//GEN-LAST:event_jTNumeroTarjetaActionPerformed

    /**
    * @param args the command line arguments
    */
    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBCancelarComprarOnline;
    private javax.swing.JButton jBComprarOnline1;
    private javax.swing.JComboBox jCBancos;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPasswordField jPasswordFieldClaveTarjeta;
    private javax.swing.JRadioButton jRDelivery;
    private javax.swing.JRadioButton jRSurcusal;
    private javax.swing.JTextField jTFactura;
    private javax.swing.JTextField jTFecha;
    private javax.swing.JTextField jTNumeroTarjeta;
    private javax.swing.JTextField jTTotal;
    // End of variables declaration//GEN-END:variables

}
